"Can Money Buy Control of Congress?"

William Minozzi - The Ohio State University - minozzi.1@osu.edu (corresponding author)
David A. Siegel - Duke University
Gabriel J. Madison - RTI International

**********************************************************************

Compute environment:

Analyses were conducted on a personal computer (MacBook Pro, 2 GHz Quad-Core Intel Core i5, 16 GB 3733 MHz LPDDr4X).

sessionInfo():

R version 4.3.0 (2023-04-21)Platform: x86_64-apple-darwin20 (64-bit)Running under: macOS Ventura 13.6Matrix products: defaultBLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib LAPACK: /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0locale:[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8time zone: America/New_Yorktzcode source: internalattached base packages:[1] stats     graphics  grDevices utils     datasets  methods   base     loaded via a namespace (and not attached): [1] utf8_1.2.3        R6_2.5.1          tidyselect_1.2.0  magrittr_2.0.3    [5] glue_1.6.2        tibble_3.2.1      pkgconfig_2.0.3   dplyr_1.1.3       [9] generics_0.1.3    lifecycle_1.0.3   cli_3.6.1         fansi_1.0.4      [13] vctrs_0.6.3       compiler_4.3.0    rstudioapi_0.15.0 tools_4.3.0      [17] pillar_1.9.0      rlang_1.1.1 

**********************************************************************

Required packages (versions)

paralleldata.tablebigKRLS (install via GitHub)e1071
glmnet
randomForestcowplotggplot2ggridgesextrafontCairo

**********************************************************************

List of files:

DATA FILES

data-2021-02-22.RData

CODE
01-set-up-directory-structure.R02-make-house-analysis-data.R03-make-senate-analysis-data.R04-krls.R05-estimate-counterfactuals.R
06-svm.R07-krls-dichotomous-outcomes.R08-krls-include-lags.R09-lasso.R10-random-forest.R11-figures.R12-tables.R13-reported-quantities.R14-online-appendix.Rfunctions.R

**********************************************************************

Recommended replication procedure:
1. Using RStudio, start a new Rproject and put all replication files in its folder.
2. Run 01-set-up-directory-structure.R interactively from the console.
4. Run scripts with prefixes in sequence, either interactively or via Background Jobs.

**********************************************************************

Data objects and data descriptions

house_data
Class: data.table/data.frame
100 columnsyeardistrict dem_candid dem_fecid rep_candid rep_fecid dem_vote: number of votes cast in district for Democratic house candidate  rep_vote: number of votes cast in district for Democratic house candidate dem_vote_share: dem_vote / (dem_vote + rep_vote)redistricted: dummy for whether a variable was redistricted; sourced from Jacobsonunopposed: dummy for whether race included only one major party candidateopen_seat: dummy for whether election was for an open seat  contest_type: Jacobson's code for combined challenger qualities of major candidatesthirdother: dummy for presence of significant (i.e. earning more than 10% of total votes) third party/independent candidate dem_incumbent: dummy for whether Democratic candidate is incumbent rep_incumbent: dummy for whether Republican candidate is incumbentquality_challenger: dummy for presence of quality challenger dem_inc_lq_chal: dummy for Democratic incumbent, low quality challenger dem_inc_hq_chal: dummy for Democratic incumbent, high quality challenger  rep_inc_lq_chal: dummy for Republican incumbent, low quality challenger  rep_inc_hq_chal: dummy for Republican incumbent, high quality challenger  open_both_hi: dummy for open seat, both high quality candidates open_hi_dem_lo_rep: dummy for open seat, only Dem is high qualityopen_lo_dem_hi_rep: dummy for open seat, only Rep is high qualitydem_nat_pres_vote: number of votes cast nationally for Democratic presidential candidaterep_nat_pres_vote: number of votes cast nationally for Republican presidential candidatedem_presvote_advantage: dem_presvote - rep_presvoteadj_dem_presvote_advantage: dem_presvote_advantage - 50 * (dem_nat_pres_vote - rep_nat_pres_vote) / (dem_nat_pres_vote + rep_nat_pres_vote)dem_cfscore: CF score for Democratic candidate rep_cfscore: CF score for Republican candidateideological_distance: abs(dem_cfscore-rep_cfscore)nom_dem_expenditure: nominal value of Democratic candidates spendingnom_rep_expenditure: nominal value of Republican candidates spendingnom_dem_outside_spending: nominal value of outside spending indicated in support of Democratic candidate or in opposition to Republican candidatenom_rep_outside_spending: nominal value of outside spending indicated in support of Republican candidate or in opposition to Democratic candidatenom_dem_expenditure_w_outside: nom_dem_expenditure + nom_dem_outside_spendingnom_rep_expenditure_w_outside: nom_rep_expenditure + nom_dem_outside_spendingnom_total_spending: nom_dem_expenditure + nom_rep_expenditurenom_total_outside_spending: nom_dem_outside_spending + nom_rep_outside_spendingnom_total_spending_w_outside: nom_dem_expenditure_w_outside + nom_rep_expenditure_w_outsidenom_dem_expenditure_advantage: nom_dem_expenditure - nom_rep_expenditurenom_dem_expenditure_advantage_w_outside: nom_dem_expenditure_w_outside - nom_rep_expenditure_w_outsidereal_*: real (i.e., inflation-adjusted) versions of variables indicated by nom_*lag_*: lagged values of variable indicated by *year_pres_vote: year from which presidential vote share is sourcedyear_scale: scaled (mean-centered, standardized) year  y80-y18: year dummies

senate_data
Class: data.table/data.frame
95 columnsyear stabb: state abbreviation class: class of Senate seat dem_candid dem_fecid rep_candid rep_fecid dem_vote: number of votes cast in state for Democratic senate candidate  rep_vote: number of votes cast in state for Democratic senate candidate dem_vote_share: dem_vote / (dem_vote + rep_vote)open_seat: dummy for whether election was for an open seat special: dummy for whether election was off cycle jungle: dummy for whether election was a jungle primary weird_race: dummy for Jacobson's indicator for miscellaneous odd race conditions dem_incumbent: dummy for whether Democratic candidate is incumbent rep_incumbent: dummy for whether Republican candidate is incumbentdem_presvote: number of votes cast in state for Democratic presidential candidate rep_presvote: number of votes cast in state for Democratic presidential candidate dem_nat_pres_vote: number of votes cast nationally for Democratic presidential candidaterep_nat_pres_vote: number of votes cast nationally for Republican presidential candidatedem_presvote_advantage: dem_presvote - rep_presvoteadj_dem_presvote_advantage: dem_presvote_advantage - 50 * (dem_nat_pres_vote - rep_nat_pres_vote) / (dem_nat_pres_vote + rep_nat_pres_vote)voting_eligible_population: number of voting eligible population in state dem_cfscore: CF score for Democratic candidate rep_cfscore: CF score for Republican candidateideological_distance: abs(dem_cfscore-rep_cfscore)nom_dem_expenditure: nominal value of Democratic candidates spendingnom_rep_expenditure: nominal value of Republican candidates spendingnom_dem_outside_spending: nominal value of outside spending indicated in support of Democratic candidate or in opposition to Republican candidatenom_rep_outside_spending: nominal value of outside spending indicated in support of Republican candidate or in opposition to Democratic candidatenom_dem_expenditure_w_outside: nom_dem_expenditure + nom_dem_outside_spendingnom_rep_expenditure_w_outside: nom_rep_expenditure + nom_dem_outside_spendingnom_total_spending: nom_dem_expenditure + nom_rep_expenditurenom_total_outside_spending: nom_dem_outside_spending + nom_rep_outside_spendingnom_total_spending_w_outside: nom_dem_expenditure_w_outside + nom_rep_expenditure_w_outsidenom_dem_expenditure_advantage: nom_dem_expenditure - nom_rep_expenditurenom_dem_expenditure_advantage_w_outside: nom_dem_expenditure_w_outside - nom_rep_expenditure_w_outsidereal_*: real (i.e., inflation-adjusted) versions of variables indicated by nom_*lag_*: lagged values of variable indicated by *year_pres_vote: year from which presidential vote share is sourcedyear_scale: scaled (mean-centered, standardized) year  y80-y18: year dummiesunincluded_house_seat_totals
Class: data.table/data.frame
4 columns:
year: integer, 1980-2018
NA: number of uncontested, independent-held seats 
D: number of uncontested, Dem-held seats 
R: number of uncontested, Rep-held seats 

unincluded_senate_seat_totals
Class: data.table/data.frame
3 columns:
year: integer, 1980-2018
D: number of uncontested, Dem-held seats 
R: number of uncontested, Rep-held seats 